package io;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesTest {
    public static void main(String[] args) {
        Properties properties = new Properties();
        try {
            properties.load(new FileReader("E:\\java\\springcloud\\io-流\\src\\io\\application.properties"));
            System.out.println(properties.get("username"));
            System.out.println(properties.get("password"));
            Object o = properties.setProperty("k1", "V1");
            properties.store(new FileWriter("E:\\java\\springcloud\\io-流\\src\\io\\application.properties"),"插入数据");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
